﻿using Microsoft.ServiceBus.Messaging;
using Microsoft.WindowsAzure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace SBWeb.Controllers
{
    public class HomeController : Controller
    {
        //
        // GET: /Home/

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult CallQueue()
        {
            const string QueueName = "ProcessingQueue";
            string connectionString = CloudConfigurationManager.GetSetting("MySbQueue");

            // Initialize the connection to Service Bus Queue
            var Client = QueueClient.CreateFromConnectionString(connectionString, QueueName);
            Client.Send(new BrokeredMessage());

            return View();
        }

    }
}
